#ifndef PREVIEWWINDOW_H
#define PREVIEWWINDOW_H

#include <QtGui/QMainWindow>
#include <QGraphicsScene>
#include "graphicshybridview.h"
#include "pannableview.h"
#include <QDebug>

class QWebFrame;
class QWebView;

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
	MainWindow(QString widgetIdentifier, QString filePath, bool panningEnabled, QWidget *parent = 0);
	MainWindow(QString debug, QWidget *parent = 0);

    QWebFrame *webFrame() { return m_hybridView->page()->mainFrame(); }
	void resizeView(int width, int height);
    
private slots:
    void selectFile();
    void resizeW240H320();
    void resizeW320H240();
    void resizeW360H640();
    void resizeW640H360();
    void resizeW800H480();
	void contentsSizeChanged(QSize newSize);

private:
	void openWidget(QString widgetIdentifier, QString filePath);

private:
	PannableView *m_pannableView;
	GraphicsHybridView *m_hybridView;
    QGraphicsScene m_scene;
    QGraphicsView m_view;
	bool m_panningEnabled;
};

#endif // PREVIEWWINDOW_H
